package file;

import java.io.File;
import java.io.FileFilter;

public class Test {
    public static void main(String[] args) {
        File dir=new File("./src/main/java/file");
        if (dir.isDirectory()){
            FileFilter filter=new FileFilter() {

                public boolean accept(File pathname) {
                    String name=pathname.getName();
                    //return name.startsWith("D");
                    long len=pathname.length();
                    return len<=700;
                }
            };

            File[] subs=dir.listFiles(filter);//回调模式
            for (File xc:subs){
                System.out.println(xc.getName());
            }
        }
    }
}
